<?
class ConverterFactory {
	static public function forName($name) {
		$name.= 'Converter';
		if (!class_exists($name)) {
			$file= 'ri/converter/'.$name.'.php';
			if (!require_once($file))
				throw new InvalidArgumentException('Unable to include converter file: '.$file);
			if (!class_exists($name))
				throw new InvalidArgumentException('Converter class not found: '.$name);
		}
		return new $name();
	}
}